package cn.tedu.tmall.server.util;


import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class AMQPUtil {

    @Autowired
    Channel channel;

    public void setExchange(String name,String extype) throws IOException {
        channel.exchangeDeclare(name,extype);
    }

    public void setQueue(String name) throws IOException {
        channel.queueDeclare(name,false,false,false,null);
    }

}
